package adv2;

import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class ListTest {
    public static void main(String[] args) {
        List list=new ArrayList();
        list.add("laohu");
        list.add("老虎");
        list.add(2<1);
        list.add(Math.E);
        list.add("老虎");
        list.add(44);
        System.out.println(list);
        System.out.println(list.size());
        System.out.println("遍历方式1：");
        for (int i = 0; i < list.size(); i++) {
            System.out.print(list.get(i)+" ");
        }
        System.out.println();
        System.out.println("增强for:");
        for (Object o:list){
            System.out.print(o+" ");
        }
        System.out.println();
        System.out.println(list.contains("老虎"));
        System.out.println(list.indexOf("老虎"));
        System.out.println(list.indexOf("小虎"));
        boolean del = list.remove("老虎");
        System.out.println("删除后："+list);
    }
}
